mtree: Load traversed subdirs when creating parents
authorColin Walters <walters@verbum.org>
Fri, 18 Feb 2022 15:24:13 +0000 (10:24 -0500)
committerColin Walters <walters@verbum.org>
Fri, 18 Feb 2022 15:30:27 +0000 (10:30 -0500)
commitf36a940ed04eb3fd2f68565ebbe46e17a9d00f53
tree44ba167a4d29c395ef9b30ab9b44453e53de95fc
parent929f62c59eff22c546208375193d97a7926e2294
mtree: Load traversed subdirs when creating parents

I'm working on enhancing the ostree-rs-ext test suite and I hit
a bug where walking a mtree and creating a parent would fail to
load lazy intermediate directories, e.g.:

/ -> usr -> bin

If we walked we'd load `/` but keep `usr` lazy, and then invalidation
would crash because it wasn't loaded.

If we're going to mutate a subdir, we need to have all the parents
loaded.

I know this is missing tests, but...it's a bit tedious to do with
the existing C tests.  Eventually soon we'll execute on merging
all 3 repos, and better share test suites.
src/libostree/ostree-mutable-tree.c